package maa.action.all;

import maa.action.Action;
import maa.action.ActionResult;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Logout implements Action {
    @Override
    public ActionResult execute(HttpServletRequest req, HttpServletResponse resp) throws Exception {
        ActionResult actionResult = new ActionResult();
        req.getSession().invalidate();
        actionResult.setResult("main");
        actionResult.setRedirected(true);
        return actionResult;
    }
}
